import './App.scss'
import { Router, Route, Switch, Redirect } from 'react-router-dom'
import Layout from './pages/layout'
import Login from './pages/login'
import NotFound from './pages/404'
import Test from '@/pages/test'
import { customHistory } from './utils/history'
import Edit from '@/pages/profile/Edit/index'
function App() {
  return (
    <Router history={customHistory}>
      <div className="app">
        {/* 配置路由 */}
        <Switch>
          <Redirect exact from="/" to="/home"></Redirect>
          <Route path="/home" component={Layout}></Route>
          <Route path="/login" component={Login}></Route>
          <Route path="/test" component={Test}></Route>
          <Route path="/profile/edit" component={Edit}></Route>
          {/* 兜底404 ，不用加path，上面都显示不到的就会匹配404*/}
          <Route component={NotFound}></Route>
        </Switch>
      </div>
    </Router>
  )
}

export default App
